import request from '@/utils/request'
/**
 *
 * @returns 树形结构需要的数据
 */
export const departmentDataAPI = () => request.get('/company/department')
/**
 *
 * @returns 项目负责人的获取
 */
export const getDepartmentsAPI = () => request.get('/sys/user/simple')

/**
 *新增子部门接口方法
 * @param {Object} data 新增部门表单数据对象
 */
export const DeptaddAPI = data => request.post('/company/department', data)
/**
 *
 * @param {Number} id 传递编辑部门id值
 * @returns 返回编辑部门表单数据
 */
export const getDepartmentDetailAPI = (id) => request.get(`/company/department/${id}`)
/**
 *
 * @param {Object} data 修改后的表单数据
 * @returns 修改部门信息的接口
 */
export const updateDepartmentAPI = data => request.put(`/company/department/${data.id}`, data)

export const deleteDepartmentAPI = id => request.delete(`/company/department/${id}`)
